There are the questions of the hour. With everyday increase in delta variant cases worldwide, there is panic in the population.
The delta variant (B.1.617.2) of the corona virus (SARS-CoV-2, is contributing to surge in India and now its widespread has been identified and recognized across the world. According to the research analysis of the yale university, the delta variant is 50% more contagious than the alpha variant originated in UK. Data has proved that even in current times, the most of hospitalizations is because of the unvaccinations. According to CDC, fully vaccinated can still spread the delta variant. The research analysis also proves that J&J vaccines are highly effective against the delta variant.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import plotly.express as px
import seaborn as sns
from scipy.stats import ttest_ind
import statsmodels.api as ss
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
var = pd.read_csv('covid-variants.csv')
vacc= pd.read_csv('country_vaccinations.csv')
latest = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/08-06-2021.csv')
#renaming col name in varianst dataset
var =var.rename(columns={'location':'country'})
latest =latest.rename(columns={'Country_Region':'country'})
latest =latest.rename(columns={'US':'United States'})
# MERGE 1 varinats and vaccines # LEFT JOIN
cases = pd.merge(var,vacc, on= "country",how='left')
cases.dropna()
# changes the scientific notation to .2 decimal values
pd.options.display.float_format = '{:.2f}'.format
deaths=latest[['country','Deaths']].groupby(['country']).sum()
deaths=deaths.sort_values(ascending=False, by='Deaths').head(20)
deaths.rename(index={'US':'United States'},inplace =True)
deaths
| Deaths | |
|---|---|
| country | |
| United States | 616493 |
| Brazil | 561762 |
| India | 427371 |
| Mexico | 243733 |
| Peru | 196818 |
| Russia | 160574 |
| United Kingdom | 130482 |
| Italy | 128187 |
| Colombia | 122087 |
| France | 112347 |
| Argentina | 107213 |
| Indonesia | 104010 |
| Iran | 93086 |
| Germany | 91785 |
| Spain | 82006 |
| Poland | 75281 |
| South Africa | 74352 |
| Ukraine | 55792 |
| Turkey | 51976 |
| Chile | 35880 |
According to this report, United states ,Brazil, India , Mexico and Peru has recorded highest deaths due to covid.
#MERGE 2
latrep = pd.merge(cases,deaths, on= "country",how='left')
latrep.dropna()
# changes the scientific notation to .2 decimal values
pd.options.display.float_format = '{:.2f}'.format
varinfo=cases[['variant','num_sequences']].groupby(['variant']).sum()
varinfo = varinfo.sort_values(ascending=False, by='num_sequences')
varinfo
| num_sequences | |
|---|---|
| variant | |
| Alpha | 226034126.00 |
| non_who | 177008884.00 |
| others | 114766394.00 |
| Delta | 69607923.00 |
| B.1.177 | 38013279.00 |
| Epsilon | 13229537.00 |
| Gamma | 13021244.00 |
| Iota | 8729201.00 |
| B.1.160 | 6758627.00 |
| Beta | 6572828.00 |
| B.1.258 | 5954672.00 |
| B.1.1.519 | 4762561.00 |
| B.1.221 | 3284763.00 |
| Eta | 1548546.00 |
| S:677H.Robin1 | 1330211.00 |
| Kappa | 1197171.00 |
| S:677P.Pelican | 1009929.00 |
| Lambda | 753353.00 |
| B.1.621 | 389389.00 |
| B.1.1.277 | 262340.00 |
| B.1.367 | 198638.00 |
| B.1.620 | 173605.00 |
| B.1.1.302 | 104476.00 |
delta=latrep[latrep['variant']=='Delta'].groupby(['country','variant']).sum()
delta =delta.sort_values(ascending=False, by='num_sequences').head(10)
delta=delta.reset_index()
delta=delta[['country','variant','num_sequences','num_sequences_total','total_vaccinations','people_fully_vaccinated','Deaths']]
delta
| country | variant | num_sequences | num_sequences_total | total_vaccinations | people_fully_vaccinated | Deaths | |
|---|---|---|---|---|---|---|---|
| 0 | United Kingdom | Delta | 42138790.00 | 136900660 | 314317394028.00 | 104709971553.00 | 1011887910.00 |
| 1 | United States | Delta | 7867982.00 | 147972243 | 1379373457210.00 | 600503986198.00 | 4800014498.00 |
| 2 | Denmark | Delta | 3116883.00 | 30192162 | 15578339733.00 | 6612218646.00 | 0.00 |
| 3 | India | Delta | 2990799.00 | 7753991 | 988950434240.00 | 189154884864.00 | 2776202016.00 |
| 4 | Germany | Delta | 1474070.00 | 31715268 | 247436307028.00 | 90888946234.00 | 689672490.00 |
| 5 | Italy | Delta | 1054500.00 | 8761230 | 161287848017.00 | 59589396104.00 | 882182934.00 |
| 6 | Sweden | Delta | 1012542.00 | 17646780 | 5150712256.00 | 1830978816.00 | 0.00 |
| 7 | Netherlands | Delta | 913716.00 | 9196728 | 7268574060.00 | 2580247624.00 | 0.00 |
| 8 | Spain | Delta | 911640.00 | 9063789 | 98706961980.00 | 39321692025.00 | 576420174.00 |
| 9 | France | Delta | 853281.00 | 10767562 | 169374781437.00 | 60589412921.00 | 769689297.00 |
Is there any ind of association between the delta varaint number seuqnces and total vaccinataions in top 10 listed countries?
delta['num_sequences'].corr(delta['total_vaccinations'])
0.12600079283189067
Is there any evidence that shows that delta varaint cases is decreased with total vaccinations and deaths?
y=delta['num_sequences']
x=delta['total_vaccinations']
z=delta['Deaths']
model=ss.OLS(x,y+z).fit()
prediction=model.predict(x)
model.summary()
C:\ProgramData\Anaconda3\lib\site-packages\scipy\stats\stats.py:1603: UserWarning: kurtosistest only valid for n>=20 ... continuing anyway, n=10
warnings.warn("kurtosistest only valid for n>=20 ... continuing "
| Dep. Variable: | total_vaccinations | R-squared (uncentered): | 0.984 |
|---|---|---|---|
| Model: | OLS | Adj. R-squared (uncentered): | 0.982 |
| Method: | Least Squares | F-statistic: | 549.5 |
| Date: | Mon, 09 Aug 2021 | Prob (F-statistic): | 2.23e-09 |
| Time: | 02:20:26 | Log-Likelihood: | -264.01 |
| No. Observations: | 10 | AIC: | 530.0 |
| Df Residuals: | 9 | BIC: | 530.3 |
| Df Model: | 1 | ||
| Covariance Type: | nonrobust |
| coef | std err | t | P>|t| | [0.025 | 0.975] | |
|---|---|---|---|---|---|---|
| x1 | 299.1808 | 12.763 | 23.441 | 0.000 | 270.309 | 328.053 |
| Omnibus: | 4.331 | Durbin-Watson: | 1.635 |
|---|---|---|---|
| Prob(Omnibus): | 0.115 | Jarque-Bera (JB): | 1.468 |
| Skew: | 0.902 | Prob(JB): | 0.480 |
| Kurtosis: | 3.520 | Cond. No. | 1.00 |
fig=plt.figure()
ax=fig.add_axes([0,0,2,1])
plt.plot(delta['country'],delta['num_sequences'],'b--',label='deltavariant_num_sequences')
plt.plot(delta['country'],delta['num_sequences_total'],'r--',label='deltavariant_num_sequences_total')
#plt.plot(delta['country'],delta['total_vaccinations'],'o--',label='total_vaccinations')
#plt.plot(delta['country'],delta['people_fully_vaccinated'],'g--',label='people_fully_vaccinated')
#plt.plot(delta['country'],delta['Deaths'],'y--',label='Deaths')
plt.legend(loc='upper right')
plt.title ("Country wise comparison chart")
plt.show()
fig=plt.figure()
ax=fig.add_axes([0,0,2,1])
plt.plot(delta['country'],delta['num_sequences'],'b--',label='deltavariant_num_sequences')
plt.plot(delta['country'],delta['num_sequences_total'],'r--',label='deltavariant_num_sequences_total')
plt.plot(delta['country'],delta['total_vaccinations'],'o--',label='total_vaccinations')
plt.plot(delta['country'],delta['people_fully_vaccinated'],'g--',label='people_fully_vaccinated')
plt.plot(delta['country'],delta['Deaths'],'y--',label='Deaths')
plt.legend(loc='upper right')
plt.title ("Country wise comparison chart")
plt.show()
# correlation
corr = cases.corr()
plt.figure(figsize=(10,8))
sns.heatmap(corr,cmap ="PiYG",annot=True)
<AxesSubplot:>
delta=latrep[latrep['variant']=='Delta'].groupby(['country','variant']).sum()
delta =delta.sort_values(ascending=False, by='num_sequences_total')
delta=delta.reset_index()
fig = px.choropleth(delta, locations="country",
color="num_sequences_total",
locationmode='country names',
color_continuous_scale=px.colors.sequential.Plasma,
title="Delta Cases in the world in last two weeks",
height=600)
fig.show()